drm/i915/cmdparser: Use explicit goto for error paths
authorJon Bloomfield <jon.bloomfield@intel.com>
Thu, 27 Sep 2018 17:23:17 +0000 (10:23 -0700)
committerBen Hutchings <ben@decadent.org.uk>
Tue, 19 Nov 2019 01:43:33 +0000 (01:43 +0000)
commita5ba29d791ece6281698c10af9cac0051a306950
tree25a5452b4d080caf3e7eaa209e582ebab152d2ff
parentb3084b265c6d72e396a542c083f4250154b26a3f
drm/i915/cmdparser: Use explicit goto for error paths

commit 0546a29cd884fb8184731c79ab008927ca8859d0 upstream.

In the next patch we will be adding a second valid
termination condition which will require a small
amount of refactoring to share logic with the BB_END
case.

Refactor all error conditions to jump to a dedicated
exit path, with 'break' reserved only for a successful
parse.

Cc: Tony Luck <tony.luck@intel.com>
Cc: Dave Airlie <airlied@redhat.com>
Cc: Takashi Iwai <tiwai@suse.de>
Cc: Tyler Hicks <tyhicks@canonical.com>
Signed-off-by: Jon Bloomfield <jon.bloomfield@intel.com>
Reviewed-by: Chris Wilson <chris.p.wilson@intel.com>
Gbp-Pq: Topic bugfix/x86/i915
Gbp-Pq: Name 0008-drm-i915-cmdparser-Use-explicit-goto-for-error-paths.patch
drivers/gpu/drm/i915/i915_cmd_parser.c